var mqtt = require('mqtt')
var client = mqtt.connect('mqtt://localhost', {
  clientId: 'server_123456',
  username: 'server_123456_username',
  password: 'server_123456_password'
})

client.on('connect', function() {
  client.subscribe('server_123456')
})

client.on('error', function(err) {
  console.log(err.message)
})

client.on('message', function(topic, message) {
  // message is Buffer
  console.log(message.toString())
})
